package ${c.module.totalPackage}.${c.module.moduleName}.service;

import java.io.Serializable;
<#if c.hasManyToOne>
import java.util.List;
</#if>
import com.guinea.core.orm.HibernateDao;
import com.guinea.core.service.EntityService;
import ${c.module.totalPackage}.${c.module.moduleName}.dao.${c.name}Dao;
import ${c.module.totalPackage}.${c.module.moduleName}.entity.${c.name};

public class ${c.name}Service extends EntityService {
	private ${c.name}Dao ${c.name?uncap_first}Dao;

	public ${c.name} get${c.name}(Serializable id) {
		return (${c.name}) get${c.name}Dao().get(id);
	}

	public HibernateDao getEntityDao() {
		return ${c.name?uncap_first}Dao;
	}

	public ${c.name}Dao get${c.name}Dao() {
		return ${c.name?uncap_first}Dao;
	}

	public void set${c.name}Dao(${c.name}Dao ${c.name?uncap_first}Dao) {
		this.${c.name?uncap_first}Dao = ${c.name?uncap_first}Dao;
	}
	<#if c.hasManyToOne>

	public List getBy<#list c.manyToOne as o>${o.className}</#list>(<#list c.manyToOne as o><#if o_index != 0>, </#if>Long ${o.refId}</#list>) {
		return get${c.name}Dao().getBy<#list c.manyToOne as o>${o.className}</#list>(<#list c.manyToOne as o><#if o_index != 0>, </#if>${o.refId}</#list>);
	}
	</#if>
	
}
